﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ERP_RORZE_DLL.Assembly
{
    public partial class AssemblyPanel : UserControl
    {
        private bool f5planLoad;
        private bool f5searchLoad;
        private bool f5wtsLoad;
        private bool f5localtroubleLoad;
        private bool f5exporttroubleLoad;
        private bool f4serialinputLoad;
        private bool f4wtsLoad;
        private bool f4exportLoad;
        private bool f4searchLoad;
        private bool f4localtroubleLoad;
        private bool f4exporttroubleLoad;
        private bool materialorderLoad;
        //private bool remainstoreestimateLoad;
        //private bool exportrobotplanLoad;
        //private bool exportpartplanLoad;
        //private bool iqlasttimeremainLoad;
        //private bool rzcodeLoad;
        //private bool rzconsumptionLoad;
        private panel_F5Plan panel_F5Plan;
        private panel_F5Search panel_F5Search;
        private panel_F5AssemblyWTS panel_F5AssemblyWTS;
        private panel_F5LocalTroubles panel_F5LocalTroubles;
        private panel_F5ExportTroubles panel_F5ExportTroubles;
        private panel_F4SerialInput panel_F4SerialInput;
        private panel_F4AssemblyWTS panel_F4AssemblyWTS;
        private panel_F4Search panel_F4Search;
        private panel_F4LocalTroubles panel_F4LocalTroubles;
        private panel_F4ExportTroubles panel_F4ExportTroubles;
        private panel_MaterialOrder panel_MaterialOrder;
        private panel_F4Export panel_F4Export;
        //private panel_ExportRobotPlan panel_ExportRobotPlan;
        //private panel_ExportPartPlan panel_ExportPartPlan;
        //private panel_IQLastTimeRemain panel_IQLastTimeRemain;
        //private panel_RZCode panel_RZCode;
        //private panel_RZConsumption panel_RZConsumption;
        
        public AssemblyPanel()
        {
            InitializeComponent();
            this.f5planLoad = false;
            this.f5searchLoad = false;
            this.f5wtsLoad = false;
            this.f5localtroubleLoad = false;
            this.f5exporttroubleLoad = false;
            this.f4serialinputLoad = false;
            this.f4wtsLoad = false;
            this.f4exportLoad = false;
            this.f4searchLoad = false;
            this.f4localtroubleLoad = false;
            this.f4exporttroubleLoad = false;
            this.materialorderLoad = false;
            
            this.assemblyLeftPannel.assemblyLeftPanel.LinkClicked +=assemblyLeftPanel_LinkClicked;
        }

        void assemblyLeftPanel_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            switch (e.Link.Item.Name)
            {
                case "navF5AssemblyPlanning":                     
                    // panel_F5Plan
                    //
                    
                    if (!f5planLoad)
                    {
                        this.panel_F5Plan = new ERP_RORZE_DLL.Assembly.panel_F5Plan();
                        f5planLoad = true;
                    }
                    else
                    {
                        this.panel_F5Plan.Dispose();
                        this.panel_F5Plan = new ERP_RORZE_DLL.Assembly.panel_F5Plan();
                    }
                    this.panelRight.Controls.Clear();
                    this.panelRight.Controls.Add(this.panel_F5Plan);
                    this.panel_F5Plan.Dock = System.Windows.Forms.DockStyle.Fill;
                    this.panel_F5Plan.Location = new System.Drawing.Point(2, 2);
                    this.panel_F5Plan.Name = "panel_F5Plan";
                    this.panel_F5Plan.Size = new System.Drawing.Size(697, 425);
                    this.panel_F5Plan.TabIndex = 0; 
                    break;

                case "navF5Search":
                    // 
                    // panel_F5Search
                    //

                    if (!f5searchLoad)
                    {
                        this.panel_F5Search = new ERP_RORZE_DLL.Assembly.panel_F5Search();
                        f5searchLoad = true;
                    }
                    else
                    {
                        this.panel_F5Search.Dispose();
                        this.panel_F5Search = new ERP_RORZE_DLL.Assembly.panel_F5Search();
                    }
                    this.panelRight.Controls.Clear();
                    this.panelRight.Controls.Add(this.panel_F5Search);
                    this.panel_F5Search.Dock = System.Windows.Forms.DockStyle.Fill;
                    this.panel_F5Search.Location = new System.Drawing.Point(2, 2);
                    this.panel_F5Search.Name = "panel_F5Search";
                    this.panel_F5Search.Size = new System.Drawing.Size(697, 425);
                    this.panel_F5Search.TabIndex = 0; 
                    break;

                case "navF5AssemblyWTS":
                    // 
                    // panel_F5AssemblyWTS
                    //
                    
                    if (!f5wtsLoad)
                    {
                        this.panel_F5AssemblyWTS = new ERP_RORZE_DLL.Assembly.panel_F5AssemblyWTS();
                        f5wtsLoad = true;
                    }
                    else
                    {
                        this.panel_F5AssemblyWTS.Dispose();
                        this.panel_F5AssemblyWTS = new ERP_RORZE_DLL.Assembly.panel_F5AssemblyWTS();
                    }
                    this.panelRight.Controls.Clear();
                    this.panelRight.Controls.Add(this.panel_F5AssemblyWTS);
                    this.panel_F5AssemblyWTS.Dock = System.Windows.Forms.DockStyle.Fill;
                    this.panel_F5AssemblyWTS.Location = new System.Drawing.Point(2, 2);
                    this.panel_F5AssemblyWTS.Name = "panel_F5AssemblyWTS";
                    this.panel_F5AssemblyWTS.Size = new System.Drawing.Size(697, 425);
                    this.panel_F5AssemblyWTS.TabIndex = 0; 
                    break;

                case "navF5LocalError":
                    // 
                    // panel_F5LocalTroubles
                    //
                    
                    if (!f5localtroubleLoad)
                    {
                        this.panel_F5LocalTroubles = new ERP_RORZE_DLL.Assembly.panel_F5LocalTroubles();
                        f5localtroubleLoad = true;
                    }
                    else
                    {
                        this.panel_F5LocalTroubles.Dispose();
                        this.panel_F5LocalTroubles = new ERP_RORZE_DLL.Assembly.panel_F5LocalTroubles();
                    }
                    this.panelRight.Controls.Clear();
                    this.panelRight.Controls.Add(this.panel_F5LocalTroubles);
                    this.panel_F5LocalTroubles.Dock = System.Windows.Forms.DockStyle.Fill;
                    this.panel_F5LocalTroubles.Location = new System.Drawing.Point(2, 2);
                    this.panel_F5LocalTroubles.Name = "panel_F5LocalTroubles";
                    this.panel_F5LocalTroubles.Size = new System.Drawing.Size(697, 425);
                    this.panel_F5LocalTroubles.TabIndex = 0;
                    break;

                case "navF5ExportError":
                    // 
                    // panel_F5ExportTroubles
                    //

                    if (!f5exporttroubleLoad)
                    {
                        this.panel_F5ExportTroubles = new ERP_RORZE_DLL.Assembly.panel_F5ExportTroubles();
                        f5exporttroubleLoad = true;
                    }
                    else
                    {
                        this.panel_F5ExportTroubles.Dispose();
                        this.panel_F5ExportTroubles = new ERP_RORZE_DLL.Assembly.panel_F5ExportTroubles();
                    }
                    this.panelRight.Controls.Clear();
                    this.panelRight.Controls.Add(this.panel_F5ExportTroubles);
                    this.panel_F5ExportTroubles.Dock = System.Windows.Forms.DockStyle.Fill;
                    this.panel_F5ExportTroubles.Location = new System.Drawing.Point(2, 2);
                    this.panel_F5ExportTroubles.Name = "panel_F5ExportTroubles";
                    this.panel_F5ExportTroubles.Size = new System.Drawing.Size(697, 425);
                    this.panel_F5ExportTroubles.TabIndex = 0;
                    break;

                case "navSerialInput":
                    // 
                    // panel_F4SerialInput
                    //

                    if (!f4serialinputLoad)
                    {
                        this.panel_F4SerialInput = new ERP_RORZE_DLL.Assembly.panel_F4SerialInput();
                        f4serialinputLoad = true;
                    }
                    else
                    {
                        this.panel_F4SerialInput.Dispose();
                        this.panel_F4SerialInput = new ERP_RORZE_DLL.Assembly.panel_F4SerialInput();
                    }
                    this.panelRight.Controls.Clear();
                    this.panelRight.Controls.Add(this.panel_F4SerialInput);
                    this.panel_F4SerialInput.Dock = System.Windows.Forms.DockStyle.Fill;
                    this.panel_F4SerialInput.Location = new System.Drawing.Point(2, 2);
                    this.panel_F4SerialInput.Name = "panel_F4SerialInput";
                    this.panel_F4SerialInput.Size = new System.Drawing.Size(697, 425);
                    this.panel_F4SerialInput.TabIndex = 0;
                    break;

                case "navF4AssemblyWTS":
                    // 
                    // panel_F4AssemblyWTS
                    // 
                    
                    if (!f4wtsLoad)
                    {
                        this.panel_F4AssemblyWTS = new ERP_RORZE_DLL.Assembly.panel_F4AssemblyWTS();
                        f4wtsLoad = true;
                    }
                    else
                    {
                        this.panel_F4AssemblyWTS.Dispose();
                        this.panel_F4AssemblyWTS = new ERP_RORZE_DLL.Assembly.panel_F4AssemblyWTS();
                    }
                    this.panelRight.Controls.Clear();
                    this.panelRight.Controls.Add(this.panel_F4AssemblyWTS);
                    this.panel_F4AssemblyWTS.Dock = System.Windows.Forms.DockStyle.Fill;
                    this.panel_F4AssemblyWTS.Location = new System.Drawing.Point(2, 2);
                    this.panel_F4AssemblyWTS.Name = "panel_F4AssemblyWTS";
                    this.panel_F4AssemblyWTS.Size = new System.Drawing.Size(697, 425);
                    this.panel_F4AssemblyWTS.TabIndex = 0; 
                    break;

                case "navF4AssemblyExport":
                    // 
                    // panel_F4Export
                    //

                    if (!f4exportLoad)
                    {
                        this.panel_F4Export = new ERP_RORZE_DLL.Assembly.panel_F4Export();
                        f4exportLoad = true;
                    }
                    else
                    {
                        this.panel_F4Export.Dispose();
                        this.panel_F4Export = new ERP_RORZE_DLL.Assembly.panel_F4Export();
                    }
                    this.panelRight.Controls.Clear();
                    this.panelRight.Controls.Add(this.panel_F4Export);
                    this.panel_F4Export.Dock = System.Windows.Forms.DockStyle.Fill;
                    this.panel_F4Export.Location = new System.Drawing.Point(2, 2);
                    this.panel_F4Export.Name = "panel_F4Export";
                    this.panel_F4Export.Size = new System.Drawing.Size(697, 425);
                    this.panel_F4Export.TabIndex = 0;
                    break;

                case "navF4Search":
                    // 
                    // panel_F4Search
                    //

                    if (!f4searchLoad)
                    {
                        this.panel_F4Search = new ERP_RORZE_DLL.Assembly.panel_F4Search();
                        f4searchLoad = true;
                    }
                    else
                    {
                        this.panel_F4Search.Dispose();
                        this.panel_F4Search = new ERP_RORZE_DLL.Assembly.panel_F4Search();
                    }
                    this.panelRight.Controls.Clear();
                    this.panelRight.Controls.Add(this.panel_F4Search);
                    this.panel_F4Search.Dock = System.Windows.Forms.DockStyle.Fill;
                    this.panel_F4Search.Location = new System.Drawing.Point(2, 2);
                    this.panel_F4Search.Name = "panel_F4Search";
                    this.panel_F4Search.Size = new System.Drawing.Size(697, 425);
                    this.panel_F4Search.TabIndex = 0;
                    break;

                case "navF4LocalError":
                    // 
                    // panel_F4LocalTroubles
                    //

                    if (!f4localtroubleLoad)
                    {
                        this.panel_F4LocalTroubles = new ERP_RORZE_DLL.Assembly.panel_F4LocalTroubles();
                        f4localtroubleLoad = true;
                    }
                    else
                    {
                        this.panel_F4LocalTroubles.Dispose();
                        this.panel_F4LocalTroubles = new ERP_RORZE_DLL.Assembly.panel_F4LocalTroubles();
                    }
                    this.panelRight.Controls.Clear();
                    this.panelRight.Controls.Add(this.panel_F4LocalTroubles);
                    this.panel_F4LocalTroubles.Dock = System.Windows.Forms.DockStyle.Fill;
                    this.panel_F4LocalTroubles.Location = new System.Drawing.Point(2, 2);
                    this.panel_F4LocalTroubles.Name = "panel_F4LocalTroubles";
                    this.panel_F4LocalTroubles.Size = new System.Drawing.Size(697, 425);
                    this.panel_F4LocalTroubles.TabIndex = 0;
                    break;

                case "navF4ExportError":
                    // 
                    // panel_F4ExportTroubles
                    //

                    if (!f4exporttroubleLoad)
                    {
                        this.panel_F4ExportTroubles = new ERP_RORZE_DLL.Assembly.panel_F4ExportTroubles();
                        f4exporttroubleLoad = true;
                    }
                    else
                    {
                        this.panel_F4ExportTroubles.Dispose();
                        this.panel_F4ExportTroubles = new ERP_RORZE_DLL.Assembly.panel_F4ExportTroubles();
                    }
                    this.panelRight.Controls.Clear();
                    this.panelRight.Controls.Add(this.panel_F4ExportTroubles);
                    this.panel_F4ExportTroubles.Dock = System.Windows.Forms.DockStyle.Fill;
                    this.panel_F4ExportTroubles.Location = new System.Drawing.Point(2, 2);
                    this.panel_F4ExportTroubles.Name = "panel_F4ExportTroubles";
                    this.panel_F4ExportTroubles.Size = new System.Drawing.Size(697, 425);
                    this.panel_F4ExportTroubles.TabIndex = 0;
                    break;

                case "navMaterialOrder":
                    // 
                    // panel_MaterialOrder
                    //
                    
                    if (!materialorderLoad)
                    {
                        this.panel_MaterialOrder = new ERP_RORZE_DLL.Assembly.panel_MaterialOrder();
                        materialorderLoad = true;
                    }
                    this.panelRight.Controls.Clear();
                    this.panelRight.Controls.Add(this.panel_MaterialOrder);
                    this.panel_MaterialOrder.Dock = System.Windows.Forms.DockStyle.Fill;
                    this.panel_MaterialOrder.Location = new System.Drawing.Point(2, 2);
                    this.panel_MaterialOrder.Name = "panel_MaterialOrder";
                    this.panel_MaterialOrder.Size = new System.Drawing.Size(697, 425);
                    this.panel_MaterialOrder.TabIndex = 0; 
                    break;

                case "navPartMistake":
                    // 
                    // panel_PartReceive
                    // 
                    /*
                    if (!partmistakestatusLoad)
                    {
                        this.panel_PartMistakeStatus = new ERP_RORZE_DLL.Business.panel_PartMistakeStatus();
                        partmistakestatusLoad = true;
                    }
                    this.panelRight.Controls.Clear();
                    this.panelRight.Controls.Add(this.panel_PartMistakeStatus);
                    this.panel_PartMistakeStatus.Dock = System.Windows.Forms.DockStyle.Fill;
                    this.panel_PartMistakeStatus.Location = new System.Drawing.Point(2, 2);
                    this.panel_PartMistakeStatus.Name = "panel_PartMistakeStatus";
                    this.panel_PartMistakeStatus.Size = new System.Drawing.Size(697, 425);
                    this.panel_PartMistakeStatus.TabIndex = 0; */
                    break;
                case "navStoreInputEstimate":
                    // 
                    // panel_RemainStoreEstimate
                    //
                    /*
                    if (!remainstoreestimateLoad)
                    {
                        this.panel_RemainStoreEstimate = new ERP_RORZE_DLL.Business.panel_RemainStoreEstimate();
                        remainstoreestimateLoad = true;
                    }
                    this.panelRight.Controls.Clear();
                    this.panelRight.Controls.Add(this.panel_RemainStoreEstimate);
                    this.panel_RemainStoreEstimate.Dock = System.Windows.Forms.DockStyle.Fill;
                    this.panel_RemainStoreEstimate.Location = new System.Drawing.Point(2, 2);
                    this.panel_RemainStoreEstimate.Name = "panel_RemainStoreEstimate";
                    this.panel_RemainStoreEstimate.Size = new System.Drawing.Size(697, 425);
                    this.panel_RemainStoreEstimate.TabIndex = 0; */
                    break;

                case "navRobotPlan":
                    // 
                    // panel_ExportRobotPlan
                    //
                    /*
                    if (!exportrobotplanLoad)
                    {
                        this.panel_ExportRobotPlan = new ERP_RORZE_DLL.Business.panel_ExportRobotPlan();
                        exportrobotplanLoad = true;
                    }
                    this.panelRight.Controls.Clear();
                    this.panelRight.Controls.Add(this.panel_ExportRobotPlan);
                    this.panel_ExportRobotPlan.Dock = System.Windows.Forms.DockStyle.Fill;
                    this.panel_ExportRobotPlan.Location = new System.Drawing.Point(2, 2);
                    this.panel_ExportRobotPlan.Name = "panel_ExportRobotPlan";
                    this.panel_ExportRobotPlan.Size = new System.Drawing.Size(697, 425);
                    this.panel_ExportRobotPlan.TabIndex = 0; */
                    break;

                case "navPartPlan":
                    // 
                    // panel_ExportRobotPlan
                    //
                    /*
                    if (!exportpartplanLoad)
                    {
                        this.panel_ExportPartPlan = new ERP_RORZE_DLL.Business.panel_ExportPartPlan();
                        exportpartplanLoad = true;
                    }
                    this.panelRight.Controls.Clear();
                    this.panelRight.Controls.Add(this.panel_ExportPartPlan);
                    this.panel_ExportPartPlan.Dock = System.Windows.Forms.DockStyle.Fill;
                    this.panel_ExportPartPlan.Location = new System.Drawing.Point(2, 2);
                    this.panel_ExportPartPlan.Name = "panel_ExportPartPlan";
                    this.panel_ExportPartPlan.Size = new System.Drawing.Size(697, 425);
                    this.panel_ExportPartPlan.TabIndex = 0; */
                    break;

                case "navIQLastRemain":
                    // 
                    // panel_IQLastTimeRemain
                    //
                    /*
                    if (!iqlasttimeremainLoad)
                    {
                        this.panel_IQLastTimeRemain = new ERP_RORZE_DLL.Business.panel_IQLastTimeRemain();
                        iqlasttimeremainLoad = true;
                    }
                    this.panelRight.Controls.Clear();
                    this.panelRight.Controls.Add(this.panel_IQLastTimeRemain);
                    this.panel_IQLastTimeRemain.Dock = System.Windows.Forms.DockStyle.Fill;
                    this.panel_IQLastTimeRemain.Location = new System.Drawing.Point(2, 2);
                    this.panel_IQLastTimeRemain.Name = "panel_IQLastTimeRemain";
                    this.panel_IQLastTimeRemain.Size = new System.Drawing.Size(697, 425);
                    this.panel_IQLastTimeRemain.TabIndex = 0; */
                    break;

                case "navRZCode":
                    // 
                    // panel_RZCode
                    //
                    /*
                    if (!rzcodeLoad)
                    {
                        this.panel_RZCode = new ERP_RORZE_DLL.Business.panel_RZCode();
                        rzcodeLoad = true;
                    }
                    this.panelRight.Controls.Clear();
                    this.panelRight.Controls.Add(this.panel_RZCode);
                    this.panel_RZCode.Dock = System.Windows.Forms.DockStyle.Fill;
                    this.panel_RZCode.Location = new System.Drawing.Point(2, 2);
                    this.panel_RZCode.Name = "panel_RZCode";
                    this.panel_RZCode.Size = new System.Drawing.Size(697, 425);
                    this.panel_RZCode.TabIndex = 0; */
                    break;

                case "navRZConsumption":
                    // 
                    // panel_RZConsumption
                    //
                    /*
                    if (!rzconsumptionLoad)
                    {
                        this.panel_RZConsumption = new ERP_RORZE_DLL.Business.panel_RZConsumption();
                        rzconsumptionLoad = true;
                    }
                    this.panelRight.Controls.Clear();
                    this.panelRight.Controls.Add(this.panel_RZConsumption);
                    this.panel_RZConsumption.Dock = System.Windows.Forms.DockStyle.Fill;
                    this.panel_RZConsumption.Location = new System.Drawing.Point(2, 2);
                    this.panel_RZConsumption.Name = "panel_RZConsumption";
                    this.panel_RZConsumption.Size = new System.Drawing.Size(697, 425);
                    this.panel_RZConsumption.TabIndex = 0; */
                    break;

                default:
                    this.panelRight.Controls.Clear();
                    break;
            }
            //throw new System.NotImplementedException();
        }
    }

    ///////////////////////////////////////////
    /// Class for Create ComboBox Item
    ///////////////////////////////////////////
    public class ComboboxItem
    {
        public string Text { get; set; }
        public object Value { get; set; }

        public override string ToString()
        {
            return Text;
        }
    }
}
